package com.china08.yxyapi.repository.mg.lecture;

import java.util.Date;
import java.util.List;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import com.china08.yxyapi.entity.mg.lecture.YxyLecturePack;

/**
 * @author Richard.Wang
 * @descript 授课资源包
 */
public interface YxyLecturePackRepository extends MongoRepository<YxyLecturePack, String> {
    YxyLecturePack findById(String id);

    YxyLecturePack findByIdAndUserIdAndSchoolId(String id, String userId, String schoolId);

    List<YxyLecturePack> findByPackSizeNullOrPackSize(int i);

    @Query(value = "{'created_date' : {$gte: ?0, $lte : ?1} }")
    List<YxyLecturePack> findByCreatedDateBetween(Date startDate, Date endDate);

}
